using System;
using System.Collections.Generic;
using System.Text;
using smartBrowser.Util;
using XPExplorerBar;
using System.Threading;
using smartBrowser.GUI;

namespace smartBrowser.Task
{
    public abstract class Task
    {
        protected WebSite webSite;
        protected TabPageForm form;


        public Task(WebSite webSite, TabPageForm form)
        {
            this.webSite = webSite;
            this.form = form;
        }


        public void Start()
        {
            new Thread(new ThreadStart(Execute)).Start();
        }


        protected virtual void Execute()
        {
            this.FireCompleteEvent();
        }


        public delegate void CompleteHandler();
        public event CompleteHandler Complete;


        protected void FireCompleteEvent()
        {
            if (this.Complete != null)
                this.Complete();
        }
    }
}
